import {Module} from '@nestjs/common';
import {AppController} from './app.controller';
import { AppService} from './app.service';
import { UseClassLoggerService, UseValueLoggerService, UseFactoryLoggerService, UseValueLoggerServiceStringToken } from './logger.service';
@Module({
    controllers: [AppController],
    providers:[
        AppService,
        {
            provide: UseClassLoggerService,//Token类型 标志
            useClass: UseClassLoggerService//注册的是一个类
        },
        {
            provide: UseValueLoggerService,//Token类型 标志
            useValue: new UseValueLoggerService()//注册的是一个类
        },
       /*  {
            provide:'StringToken',//token或者说标识符
            useValue: new UseValueLoggerServiceStringToken()
        }, */
        {
            provide: UseFactoryLoggerService,//Token类型 标志
            useFactory: ()=>new UseValueLoggerService()//注册的是一个类
        }
    ]
})
export class AppModule{

}